package org.example.component;

import dev.langchain4j.model.openai.OpenAiChatModel;
import dev.langchain4j.service.AiServices;
import org.example.service.ConsultantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ComponentConfig 
{
	@Autowired
	private OpenAiChatModel model;
	
	@Bean
	public ConsultantService consultantService()
	{
		ConsultantService build = AiServices.builder(ConsultantService.class)
				.chatModel(model)
				.build();
		return build;
	}
}